Ext.define('js.basicInformation.basicInformationPanel', {
    extend: 'Ext.panel.Panel',
    id:'basicInformationPanel',
    style: "background-color:#fff;",
    margin:'0 3 0 1',
    config: {
        autoScroll: true,
        border: false,
        layout: {
            type: 'vbox',
            align: 'stretch'
        }
    },
    initComponent: function () {
        let me = this;
        let basicInformationList= {
            xtype:'panel',
            region: 'center',
            layout: {
                type: 'table',
                columns: 2
            },
            fieldDefaults: {
                labelWidth: 250,
             /*   allowBlank: false*/
            },
            frame:true,
            margin:'30 40 20 40',
            id:'basicInformationList',
            cls:'basicInformationList',
            autoHeight:true,
            ui: 'threshold1',
            border: false,
            defaults: {width: '50%', msgTarget:'side', height:36,  margin:'0 0 31 0',  msgTarget : 'qtip',},
            items: [
                {
                    xtype:'textfield',
                    name:'engineering_no',
                    id:'engineering_no',
                    readOnly:'true',
                    ref:'engineering_no',
                    labelWidth: 140,
                    value:this.engineering_no,
                    fieldLabel: '工程编号',
                    width:'80%',
                    blankText:'LP名称(中文)必须输入.'
                },{
                    xtype: 'datefield',
                    editable:false,
                    name:'startDate',
                    id:'startDate',
                    labelWidth: 140,
                    value:this.startDate,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    ref:'fullnameEn',
                    fieldLabel: '开工日期'
                },{
                    xtype:'textfield',
                    name:'engineering_name',
                    id:'engineering_name',
                    labelWidth: 140,
                    value:this.engineering_name,
                    ref:'shortnameZh',
                    width:'80%',
                    fieldLabel: '工程名称'
                },{

                    xtype:'textfield',
                    name:'principal_id',
                    id:'principal_id',
                    value:this.principal_id,
                    labelWidth: 140,
                    hidden:true,
                    ref:'shortnameZh',
                    width:'80%',
                    fieldLabel: '责任监督员id'
                }, {
                    xtype:'panel',
                    width:'90%',
                    height:'40',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    margin: '0px 0px 31px 51%',
                    items:[{
                        xtype:'textfield',
                        name:'principal_name',
                        id:'principal_name',
                        width:'50%',
                        height:'36',
                        value:this.principal_name,
                        labelWidth: 140,
                        ref:'principal_id',
                        fieldLabel: '责任监督员',
                        listeners: {
                            render: function(p) {
                                p.getEl().on('click', function(p){
                                    let a = Ext.getCmp('BasGraphAddWindow');
                                    if(a) a.remove(a);
                                    let formPanel = Ext.create('js.basicInformation.BasGraphAddWindow',{
                                        idA:'principal_id',
                                        nameA:'principal_name',
                                        actionType:'dan'
                                    });
                                    let win = util.window(formPanel, {title:'添加责任监督员' ,width:'600',height:'600'});
                                    win.show();
                                });
                            }}
                    },{
                        xtype: 'label',
                        cls:'lableshort',
                        text: '(唯一)',
                        width:'50%',
                        margin: '10 0 0 10'
                    }]
                },{
                    xtype:'panel',
                    labelWidth: 140,
                    width:'100%',
                    height:'36',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    items:[{
                        xtype:'numberfield',
                        name:'aboveGround_floor',
                        id:'aboveGround_floor',
                        width:'40%',
                        value:this.aboveGround_floor,
                        allowDecimals:false,//不允许输入小数
                        nanText:'请输入有效的整数',//无效数字提示
                        maxValue:50,//最大值
                        minValue:1,//最小值
                        labelWidth: 140,
                        ref:'lpType',
                        fieldLabel: '层数（地上-地下）'
                    },{
                        xtype: 'label',
                        cls:'lableshortA',
                        text: '-',
                        width:'2%',
                        height:'36',
                        margin: '0 0 0 10'
                    },{
                        xtype: 'numberfield',
                        name:'underGround_floor',
                        id:'underGround_floor',
                        value:this.underGround_floor,
                        msgTarget : 'qtip',
                        allowDecimals:false,//不允许输入小数
                        maxValue:5,//最大值
                        minValue:1,//最小值
                        nanText:'请输入有效的整数',//无效数字提示
                        ref:'shortnameZh',
                        width:'18%',
                        margin: '0 0 0 10'
                    }]
                },{
                    xtype: 'datefield',
                    editable:false,
                    name:'admission_construction_date',
                    id:'admission_construction_date',
                    width:'90%',
                    value:this.admission_construction_date,
                    margin: '0px 0px 31px 51%',
                    minValue:new Date(me.startDate),
                    ref:'fullnameEn',
                    labelWidth: 140,
                    fieldLabel: '首次入场日期'
                },{
                    xtype: 'combobox',
                    name: 'eng_structure_type',
                    id: 'eng_structure_typeAA',
                    fieldLabel: '结构类型',
                    value:this.structure_id,
                    allowBlank: false,
                    labelWidth: 140,
                    triggerAction: 'all',
                    msgTarget : 'qtip',
                    editable : false,
                    emptyText: '',
                    width: '80%',
                    displayField: 'dataType',
                    valueField: 'value',
                    store:  Ext.create('js.store.wide.projectStructureType',{
                        proxy: {
                            extraParams: {
                                type: 1,
                            },
                        }
                    }),
                    listeners:{
                        "expand":function(combo, store,index){
                            Ext.getCmp("eng_structure_typeAA").getStore().load();
                        }
                    }
                },{

                    xtype:'textfield',
                    name:'user_ids',
                    id:'user_ids',
                    labelWidth: 140,
                    hidden:true,
                    value:this.userIds,
                    ref:'shortnameZh',
                    width:'80%',
                    fieldLabel: '监督员id'
                },{
                    xtype: 'textfield',
                    name:'user_name',
                    id:'user_name',
                    width:'90%',
                    labelWidth: 140,
                    value:this.user_name,
                    margin: '0px 0px 31px 51%',
                    ref:'fullnameEn',
                    fieldLabel: '监督员',
                    listeners: {
                        render: function(p) {
                            p.getEl().on('click', function(p){
                                let a = Ext.getCmp('BasGraphAddWindow');
                                if(a) a.remove(a);
                                let formPanel = Ext.create('js.basicInformation.BasGraphAddWindow',{
                                    actionType:'duo',
                                    idA:'user_ids',
                                    nameA:'user_name'
                                });
                                let win = util.window(formPanel, {title:'添加监督员' ,width:'600',height:'600'});
                                win.show();
                            });
                        }}
                },{
                    xtype:'panel',
                    labelWidth: 140,
                    width:'100%',
                    height:'36',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    items:[{
                        xtype:'textfield',
                        labelWidth: 140,
                        name:'engineering_area',
                        id:'engineering_area',
                        value:this.engineering_area,
                        ref:'lpType',
                        width:'50%',
                        fieldLabel: '总面积'
                    },{
                        xtype: 'label',
                        cls:'lableshort',
                        text: 'm²',
                        width:'50%',
                        height:'36',
                        margin: '0 0 0 10'
                    }]
                },{
                    xtype: 'combobox',
                    name: 'admission_construction_status',
                    id: 'admission_construction_status',
                    fieldLabel: '入场工程状态',
                    width:'90%',
                    value:this.admission_construction_status,
                    labelWidth: 140,
                    margin: '0px 0px 31px 51%',
                   /* allowBlank: false,*/
                    triggerAction: 'all',
                    editable : false,
                    emptyText: '',
                    displayField: 'dataType',
                    valueField: 'value',
                    store:  Ext.create('js.store.wide.projectState'),
                },{
                    xtype:'textfield',
                    name:'engineering_address',
                    id:'engineering_address',
                    width:'80%',
                    labelWidth: 140,
                    value:this.engineering_address,
                    ref:'currency',
                    fieldLabel: '详细地址'
                },{
                    xtype: 'combobox',
                    name:'building_use',
                    id:'building_use',
                    width:'90%',
                    ref:'website',
                    value:this.building_use,
                    margin: '0px 0px 31px 51%',
                    labelWidth: 140,
                    displayField: 'dataType',
                    valueField: 'value',
                    editable : false,
                    store:  Ext.create('js.store.wide.projectConstructionApplications'),
                    fieldLabel: '建筑用途'
                }]
        };
        /*   let lineA={
               xtype:'panel',
               html:'______________________________________________________________________________________________________________________________________'
           }*/
        let basicInformationListA= {
            xtype:'panel',
            region: 'center',
            layout: {
                type: 'table',
                columns: 2
            },
            fieldDefaults: {
                labelWidth: 180,
            /*    allowBlank: false*/
            },
            id:'basicInformationListA',
            frame:true,
            margin:'10 40 20 40',
            autoHeight:true,
            ui: 'threshold1',
            cls:'basicInformationList',
            border: false,
            defaults: {width: '50%', msgTarget:'side', height:36,  margin:'0 0 31 0',  msgTarget : 'qtip',},
            items: [
                {
                    xtype:'textfield',
                    name:'supervisory_registration_certificate',
                    ref:'fullnameZh',
                    id:'supervisory_registration_certificate',
                    fieldLabel: '监督注册证编号',
                    value:this.supervisory_registration_certificate,
                    width:'80%',
                    labelWidth: 140,
                    allowBlank:false,
                    blankText:'LP名称(中文)必须输入.'
                },{
                    xtype:'textfield',
                    name:'planning_certificate',
                    id:'planning_certificate',
                    width:'90%',
                    labelWidth: 160,
                    value:this.planning_certificate,
                    margin: '0px 0px 31px 51%',
                    ref:'fullnameEn',
                    fieldLabel: '规划证号'
                },{
                    xtype:'textfield',
                    name:'drawing_number',
                    id:'drawing_number',
                    ref:'drawing_number',
                    value:this.drawing_number,
                    width:'80%',
                    labelWidth: 140,
                    fieldLabel: '图审编号'
                },{
                    xtype:'textfield',
                    name:'construction_permit',
                    id:'construction_permit',
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    value:this.construction_permit,
                    ref:'construction_permit',
                    fieldLabel: '施工许可证号'
                }]
        };
        let basicInformationListB={
            xtype:'panel',
            region: 'center',
            layout: {
                type: 'table',
                columns: 2
            },
            fieldDefaults: {
                labelWidth: 140,
         /*       allowBlank: false*///是否为空判断
            },
            frame:true,
            id:'basicInformationListB',
            margin:'10 40 20 40',
            autoHeight:true,
            ui: 'threshold1',
            border: false,
            defaults: {width: '50%', msgTarget:'side', height:36,  margin:'0 0 31 0',  msgTarget : 'qtip',},
            items: [
                {
                    xtype:'panel',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    width:'100%',
                    items:[{
                        xtype: 'combobox',
                        name:'construction_unit_employer_id',
                        id:'construction_unit_employer_id',
                        ref:'construction_unit_employer_id',
                        fieldLabel: '建设单位',
                        value:this.construction_unit_employer_id,
                        labelWidth: 140,
                        width:'80%',
                        /*      allowBlank:false,*/
                        blankText:'LP名称(中文)必须输入.',
                        displayField: 'dataType',
                        valueField: 'value',
                        store:  Ext.create('js.store.unit.constructionEnitEmployerStore'),
                        listeners:{
                            "expand":function(combo, store,index){
                                Ext.getCmp("construction_unit_employer_id").getStore().load();
                            }
                        }
                    },{
                        xtype:'button',
                        text:'+',
                        width:'35',
                        margin:'1 0 0 0',
                        height:32,
                        scope: this,
                        numA:1,
                        handler: this.jsdw,
                    }]
                },{
                    xtype:'textfield',
                    name:'construction_unit_employer_person',
                    id:'construction_unit_employer_person',
                    ref:'drawing_number',
                    value:this.construction_unit_employer_person,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    fieldLabel: '建设单位项目负责人'
                }, {
                    xtype:'panel',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    width:'100%',
                    items:[{
                        xtype: 'combobox',
                        name:'design_unit_id',
                        id:'design_unit_id',
                        width:'80%',
                        value:this.design_unit_id,
                        ref:'design_unit_id',
                        fieldLabel: '设计单位',
                        labelWidth: 140,
                        displayField: 'dataType',
                        valueField: 'value',
                        store:  Ext.create('js.store.unit.constructionEnitEmployerStoreA'),
                        listeners:{
                            "expand":function(combo, store,index){
                                Ext.getCmp("design_unit_id").getStore().load();
                            }
                        }
                    },{
                        xtype:'button',
                        text:'+',
                        width:'35',
                        height:32,
                        margin:'1 0 0 0',
                        scope: this,
                        numA:2,
                        handler: this.jsdw,
                        
                    }]
                },{
                    xtype:'textfield',
                    name:'design_unit_person',
                    id:'design_unit_person',
                    ref:'drawing_number',
                    value:this.design_unit_person,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    fieldLabel: '设计单位项目负责人'
                },{
                    xtype:'panel',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    width:'100%',
                    items:[{
                        xtype: 'combobox',
                        name:'construction_unit_contractor_id',
                        id:'construction_unit_contractor_id',
                        width:'80%',
                        value:this.construction_unit_contractor_id,
                        ref:'construction_unit_contractor_id',
                        fieldLabel: '施工单位',
                        labelWidth: 140,
                        displayField: 'dataType',
                        valueField: 'value',
                        store:  Ext.create('js.store.unit.constructionEnitEmployerStoreB'),
                        listeners:{
                            "expand":function(combo, store,index){
                                Ext.getCmp("construction_unit_contractor_id").getStore().load();
                            }
                        }
                    },{
                        xtype:'button',
                        text:'+',
                        height:32,
                        numA:3,
                        handler: this.jsdw,
                        width:'35',
                        margin:'1 0 0 0',
                        scope: this,
                        
                    }]
                },{
                    xtype:'textfield',
                    name:'construction_unit_contractor_person',
                    id:'construction_unit_contractor_person',
                    ref:'drawing_number',
                    value:this.construction_unit_contractor_person,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    fieldLabel: '施工单位项目负责人'
                },{
                    xtype:'panel',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    width:'100%',
                    items:[{
                        xtype: 'combobox',
                        name:'supervisory_unit_id',
                        id:'supervisory_unit_id',
                        ref:'supervisory_unit_id',
                        value:this.supervisory_unit_id,
                        width:'80%',
                        fieldLabel: '监理单位',
                        labelWidth: 140,
                        displayField: 'dataType',
                        valueField: 'value',
                        store:  Ext.create('js.store.unit.constructionEnitEmployerStoreC'),
                        listeners:{
                            "expand":function(combo, store,index){
                                Ext.getCmp("supervisory_unit_id").getStore().load();
                            }
                        }
                    },{
                        xtype:'button',
                        text:'+',
                        width:'35',
                        height:32,
                        numA:4,
                        handler: this.jsdw,
                        margin:'1 0 0 0',
                        scope: this,
                        
                    }]
                },{
                    xtype:'textfield',
                    name:'supervisory_unit_person',
                    id:'supervisory_unit_person',
                    ref:'drawing_number',
                    value:this.supervisory_unit_person,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    fieldLabel: '监理单位项目负责人'
                },{
                    xtype:'panel',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    width:'100%',
                    items:[{
                        xtype: 'combobox',
                        name:'survey_unit_id',
                        id:'survey_unit_id',
                        value:this.survey_unit_id,
                        width:'80%',
                        ref:'survey_unit_id',
                        labelWidth: 140,
                        fieldLabel: '勘察单位',
                        displayField: 'dataType',
                        valueField: 'value',
                        store:  Ext.create('js.store.unit.constructionEnitEmployerStoreD'),
                        listeners:{
                            "expand":function(combo, store,index){
                                Ext.getCmp("survey_unit_id").getStore().load();
                            }
                        }
                    },{
                        xtype:'button',
                        text:'+',
                        width:'35',
                        height:32,
                        numA:5,
                        handler: this.jsdw,
                        margin:'1 0 0 0',
                        scope: this,
                        
                    }]
                },{
                    xtype:'textfield',
                    name:'survey_unit_person',
                    id:'survey_unit_person',
                    ref:'drawing_number',
                    value:this.survey_unit_person,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    fieldLabel: '勘察单位项目负责人'
                }, {
                    xtype:'panel',
                    width:'100%',
                    layout: {
                        type: 'table',
                        columns: 2
                    },
                    autoHeight:true,
                    border: false,
                    items:[
                        {
                        xtype: 'combobox',
                        name: 'drawing_unit_id',
                        id: 'drawing_unit_id',
                        value: this.drawing_unit_id,
                        width: '85%',
                        ref: 'drawing_unit_id',
                        margin: '0px 0px 0px 0px',
                        labelWidth: 140,
                        fieldLabel: '图审单位',
                        displayField: 'dataType',
                        valueField: 'value',
                        store: Ext.create('js.store.unit.constructionEnitEmployerStoreE'),
                        listeners: {
                            "expand": function (combo, store, index) {
                                Ext.getCmp("drawing_unit_id").getStore().load();
                                }
                            }
                        },{
                            xtype:'button',
                            text:'+',
                            width: '35',
                            numA:6,
                            handler: this.jsdw,
                            height:32,
                            style:'position: relative;left: -85px',
                            margin: '0px 0px 0px 0',
                            scope: this,
                            
                        }
                    ]
                },{
                    xtype:'textfield',
                    name:'drawing_unit_person',
                    id:'drawing_unit_person',
                    ref:'drawing_number',
                    value:this.drawing_unit_person,
                    width:'90%',
                    margin: '0px 0px 31px 51%',
                    labelWidth: 160,
                    fieldLabel: '图审单位项目负责人'
                }
               ]
        };
        let buttonList={
            xtype: 'panel',
            margin:'0 40 30 40',
            layout: {
                type: 'hbox',
                align: 'middle ',
                pack: 'center'
            },
            items: [{
                xtype: 'button',
                scala: 'medium',
                cls:'button-Intelligent-sensor',
                text: '重置',
                margin:'0 100% 0 -50%',
                width: '10%',
                height:'40',
                handler: this.btnresetclick,
                scope: this,
                toOpera: 0
            }, {
                xtype: 'button',
                scala: 'medium',
                cls:'button-Intelligent-sensor',
                text: '保存修改',
                /*margin:'0 5% 0 29%',*/
                width: '10%',
                height:'40',
                handler: this.toPage,
                scope: this,
            }
            ]

        };
        let basicInformationFormList= new Ext.FormPanel({
            id:'basicInformationFormList',
            items: [
                basicInformationList,
                basicInformationListA,
                basicInformationListB,
                buttonList
            ]
        });

        this.items = [basicInformationFormList];
        this.on('render', this.show);
        this.callParent(arguments);
    },
    show:function(){
        Ext.Ajax.request({
            url: '/getUserInfoBySession',
            method: "POST",
            async: true,  //异步调用AJAX
            success: function (response, opts) {
                let result = Ext.decode(response.responseText);
                 if(result.data==true){
                 }else{
                     let engineering_areaA=Ext.getCmp('engineering_area').value;
                     let engineering_addressA=Ext.getCmp('engineering_address').value;
                     let aboveGround_floorA=Ext.getCmp('aboveGround_floor').value;
                     let underGround_floorA=Ext.getCmp('underGround_floor').value;
                     let admission_construction_dateA=Ext.getCmp('admission_construction_date').value;
                     let admission_construction_statusA=Ext.getCmp('admission_construction_status').value;
                     let supervisory_registration_certificateA=Ext.getCmp('supervisory_registration_certificate').value;
                     let planning_certificateA=Ext.getCmp('planning_certificate').value;
                     let drawing_numberA=Ext.getCmp('drawing_number').value;
                     let construction_permitA=Ext.getCmp('construction_permit').value;
                     let construction_unit_employer_idA=Ext.getCmp('construction_unit_employer_id').value;
                     let design_unit_idA=Ext.getCmp('design_unit_id').value;
                     let construction_unit_contractor_idA=Ext.getCmp('construction_unit_contractor_id').value;
                     let supervisory_unit_idA=Ext.getCmp('supervisory_unit_id').value;
                     let survey_unit_idA=Ext.getCmp('survey_unit_id').value;
                     let drawing_unit_idA=Ext.getCmp('drawing_unit_id').value;
                     let startDateA=Ext.getCmp('startDate').value;
                     let principal_idA=Ext.getCmp('principal_id').value;
                     let building_useA=Ext.getCmp('building_use').value;
                     let engineering_nameA=Ext.getCmp('engineering_name').value;
                     let userIdsA=Ext.getCmp('user_ids').value;
                     let construction_unit_employer_personA=Ext.getCmp('construction_unit_employer_person').value;
                     let design_unit_personA=Ext.getCmp('design_unit_person').value;
                     let construction_unit_contractor_personA=Ext.getCmp('construction_unit_contractor_person').value;
                     let supervisory_unit_personA=Ext.getCmp('supervisory_unit_person').value;
                     let survey_unit_personA=Ext.getCmp('survey_unit_person').value;
                     let drawing_unit_personA=Ext.getCmp('drawing_unit_person').value;
                     let eng_structure_typeA=Ext.getCmp('eng_structure_typeAA').value;
                     //判断如果不为空只读
                     if(eng_structure_typeA!==""){
                         Ext.getCmp('eng_structure_typeAA').setReadOnly(true);
                     }else{
                         Ext.getCmp('eng_structure_typeAA').setReadOnly(false);
                     }
                     if(engineering_nameA!==""){
                         Ext.getCmp('engineering_name').setReadOnly(true);
                     }else{
                         Ext.getCmp('engineering_name').setReadOnly(false);
                     }
                     if(startDateA!==""&&startDateA!=='0000-00-00'){
                         Ext.getCmp('startDate').setReadOnly(true);
                     }else{
                         Ext.getCmp('startDate').setReadOnly(false);
                     }
                     if(aboveGround_floorA!==""&&aboveGround_floorA!==0){
                         Ext.getCmp('aboveGround_floor').setReadOnly(true);
                     }else{
                         Ext.getCmp('aboveGround_floor').setReadOnly(false);
                     }
                     if(admission_construction_dateA!==""&&admission_construction_dateA!=='0000-00-00'){
                         Ext.getCmp('admission_construction_date').setReadOnly(true);
                     }else{
                         Ext.getCmp('admission_construction_date').setReadOnly(false);
                     }
                     if(underGround_floorA!==""&&underGround_floorA!==0){
                         Ext.getCmp('underGround_floor').setReadOnly(true);
                     }else{
                         Ext.getCmp('underGround_floor').setReadOnly(false);
                     }
                     if(engineering_areaA!==""&&engineering_areaA!=0){
                         Ext.getCmp('engineering_area').setReadOnly(true);
                     }else{
                         Ext.getCmp('engineering_area').setReadOnly(false);
                     }
                     if(admission_construction_statusA!==""&&admission_construction_statusA!==0&&admission_construction_statusA!==null){
                         Ext.getCmp('admission_construction_status').setReadOnly(true);
                     }else{
                         Ext.getCmp('admission_construction_status').setReadOnly(false);
                     }
                     if(engineering_addressA!==""){
                         Ext.getCmp('engineering_address').setReadOnly(true);
                     }else{
                         Ext.getCmp('engineering_address').setReadOnly(false);
                     }
                     if(building_useA!==""){
                         Ext.getCmp('building_use').setReadOnly(true);
                     }else{
                         Ext.getCmp('building_use').setReadOnly(false);
                     }
                     if(supervisory_registration_certificateA!==""){
                         Ext.getCmp('supervisory_registration_certificate').setReadOnly(true);
                     }else{
                         Ext.getCmp('supervisory_registration_certificate').setReadOnly(false);
                     }
                     if(planning_certificateA!==""){
                         Ext.getCmp('planning_certificate').setReadOnly(true);
                     }else{
                         Ext.getCmp('planning_certificate').setReadOnly(false);
                     }
                     if(drawing_numberA!==""){
                         Ext.getCmp('drawing_number').setReadOnly(true);
                     }else{
                         Ext.getCmp('drawing_number').setReadOnly(false);
                     }
                     if(construction_permitA!==""){
                         Ext.getCmp('construction_permit').setReadOnly(true);
                     }else{
                         Ext.getCmp('construction_permit').setReadOnly(false);
                     }

                     if(construction_unit_employer_idA!==""&&construction_unit_employer_idA!==null){
                         Ext.getCmp('construction_unit_employer_id').setReadOnly(true);
                     }else{
                         Ext.getCmp('construction_unit_employer_id').setReadOnly(false);
                     }
                     if(design_unit_idA!==""&&design_unit_idA!==null){
                         Ext.getCmp('design_unit_id').setReadOnly(true);
                     }else{
                         Ext.getCmp('design_unit_id').setReadOnly(false);
                     }
                     if(construction_unit_contractor_idA!==""&&construction_unit_contractor_idA!==null){
                         Ext.getCmp('construction_unit_contractor_id').setReadOnly(true);
                     }else{
                         Ext.getCmp('construction_unit_contractor_id').setReadOnly(false);
                     }
                     if(supervisory_unit_idA!==""&&supervisory_unit_idA!==null){
                         Ext.getCmp('supervisory_unit_id').setReadOnly(true);
                     }else{
                         Ext.getCmp('supervisory_unit_id').setReadOnly(false);
                     }
                     if(survey_unit_idA!==""&&survey_unit_idA!==null){
                         Ext.getCmp('survey_unit_id').setReadOnly(true);
                     }else{
                         Ext.getCmp('survey_unit_id').setReadOnly(false);
                     }
                     if(drawing_unit_idA!==""&&drawing_unit_idA!==null){
                         Ext.getCmp('drawing_unit_id').setReadOnly(true);
                     }else{
                         Ext.getCmp('drawing_unit_id').setReadOnly(false);
                     }
                     if(principal_idA!==""){
                         Ext.getCmp('principal_name').setDisabled(true);
                     }else{
                         Ext.getCmp('principal_name').setDisabled(false);
                     }
                     if(userIdsA!==""){
                         Ext.getCmp('user_name').setDisabled(true);
                     }else{
                         Ext.getCmp('user_name').setDisabled(false);
                     }
                     if(construction_unit_employer_personA!==""){
                         Ext.getCmp('construction_unit_employer_person').setReadOnly(true);
                     }else{
                         Ext.getCmp('construction_unit_employer_person').setReadOnly(false);
                     }
                     if(design_unit_personA!==""){
                         Ext.getCmp('design_unit_person').setReadOnly(true);
                     }else{
                         Ext.getCmp('design_unit_person').setReadOnly(false);
                     }
                     if(construction_unit_contractor_personA!==""){
                         Ext.getCmp('construction_unit_contractor_person').setReadOnly(true);
                     }else{
                         Ext.getCmp('construction_unit_contractor_person').setReadOnly(false);
                     }
                     if(supervisory_unit_personA!==""){
                         Ext.getCmp('supervisory_unit_person').setReadOnly(true);
                     }else{
                         Ext.getCmp('supervisory_unit_person').setReadOnly(false);
                     }
                     if(survey_unit_personA!==""){
                         Ext.getCmp('survey_unit_person').setReadOnly(true);
                     }else{
                         Ext.getCmp('survey_unit_person').setReadOnly(false);
                     }
                     if(drawing_unit_personA!==""){
                         Ext.getCmp('drawing_unit_person').setReadOnly(true);
                     }else {
                         Ext.getCmp('drawing_unit_person').setReadOnly(false);
                     }
                 }

            }
        });
    },
    jsdw:function(btn){
        let num=btn.numA
        let btnCancel = Ext.create('Ext.button.Button', {
            cls: 'btnCancel',
            text: `取消`,
            scale: 'medium',
            width:140,
            height:42,
            margin:'0 0 20 200',
            handler: function (btn) {
                btn.up('window').close();
            },
            scope: this

        });
        let btnSubmit = Ext.create('Ext.button.Button', {
            cls:'btnSubmit',
            border:false,
            text: `保存`,
            margin: '0 0 20 30',
            width:140,
            height:42,
            scale: 'medium',
            handler: function (btn) {
                    let panel =Ext.getCmp('basicInformationPanel')
                    panel.mask('正在加载数据请稍后');
                    util.post('/unitRoutes', {
                        action_type: 'unitAdd',
                        unit_type:num,
                        unit_name:Ext.getCmp('unit_nameA').getValue(),
                        enable:Ext.getCmp('enableA').getValue()
                    }).then(function (response) {
                        panel.unmask();
                        let obj = Ext.decode(response.responseText);
                        if (obj.success) {
                            Ext.toast('保存成功');
                            btn.up('window').close();
                        } else {
                            Ext.toast(`保存失败,${obj.message}`);
                        }
                    });
            },
            scope: this
        });
        let formPanel = Ext.create('js.system.UnitAAddPage');
        let win = util.window(formPanel, {title:'添加' ,width:'40%',height:'32%',  buttons: ['->', btnCancel, btnSubmit, '->']});
        win.show();

    },
    btnresetclick: function(){
       /* let basicInformationFormList=Ext.getCmp('basicInformationFormList');
        basicInformationFormList.getForm().reset();*/
         Ext.getCmp('engineering_area').setValue("");
         Ext.getCmp('engineering_address').setValue("");
        Ext.getCmp('aboveGround_floor').setValue("");
        Ext.getCmp('underGround_floor').setValue("");
       Ext.getCmp('admission_construction_date').setValue("");
        Ext.getCmp('admission_construction_status').setValue("");
        Ext.getCmp('supervisory_registration_certificate').setValue("");
        Ext.getCmp('planning_certificate').setValue("");
        Ext.getCmp('drawing_number').setValue("");
        Ext.getCmp('construction_permit').setValue("");
        Ext.getCmp('construction_unit_employer_id').setValue("");
        Ext.getCmp('design_unit_id').setValue("");
        Ext.getCmp('construction_unit_contractor_id').setValue("");
        Ext.getCmp('supervisory_unit_id').setValue("");
        Ext.getCmp('survey_unit_id').setValue("");
        Ext.getCmp('drawing_unit_id').setValue("");
        Ext.getCmp('startDate').setValue("");
        Ext.getCmp('principal_id').setValue("");
        Ext.getCmp('building_use').setValue("");
        Ext.getCmp('engineering_name').setValue("");
        Ext.getCmp('user_ids').setValue("");

        Ext.getCmp('construction_unit_employer_person').setValue("");
        Ext.getCmp('design_unit_person').setValue("");
        Ext.getCmp('construction_unit_contractor_person').setValue("");
        Ext.getCmp('supervisory_unit_person').setValue("");
        Ext.getCmp('survey_unit_person').setValue("");
        Ext.getCmp('drawing_unit_person').setValue("");
        Ext.getCmp('eng_structure_typeAA').setValue("");

    },
    toPage: function(){
        let engineering_id=this.engineering_id;
        let engineering_area=Ext.getCmp('engineering_area').value;
        let engineering_address=Ext.getCmp('engineering_address').value;
        let aboveGround_floor=Ext.getCmp('aboveGround_floor').value;
        let underGround_floor=Ext.getCmp('underGround_floor').value;
        let admission_construction_date=Ext.getCmp('admission_construction_date').value;
        let admission_construction_status=Ext.getCmp('admission_construction_status').value;
        let supervisory_registration_certificate=Ext.getCmp('supervisory_registration_certificate').value;
        let planning_certificate=Ext.getCmp('planning_certificate').value;
        let drawing_number=Ext.getCmp('drawing_number').value;
        let construction_permit=Ext.getCmp('construction_permit').value;
        let construction_unit_employer_id=Ext.getCmp('construction_unit_employer_id').value;
        let design_unit_id=Ext.getCmp('design_unit_id').value;
        let construction_unit_contractor_id=Ext.getCmp('construction_unit_contractor_id').value;
        let supervisory_unit_id=Ext.getCmp('supervisory_unit_id').value;
        let survey_unit_id=Ext.getCmp('survey_unit_id').value;
        let drawing_unit_id=Ext.getCmp('drawing_unit_id').value;
        let startDate=Ext.getCmp('startDate').value;
        let principal_id=Ext.getCmp('principal_id').value;
        let building_use=Ext.getCmp('building_use').value;
        let engineering_name=Ext.getCmp('engineering_name').value;
        let user_ids=Ext.getCmp('user_ids').value;
        let construction_unit_employer_person=Ext.getCmp('construction_unit_employer_person').value;
        let design_unit_person =Ext.getCmp('design_unit_person').value;
        let construction_unit_contractor_person=Ext.getCmp('construction_unit_contractor_person').value;
        let supervisory_unit_person=Ext.getCmp('supervisory_unit_person').value;
        let survey_unit_person=Ext.getCmp('survey_unit_person').value;
        let drawing_unit_person=Ext.getCmp('drawing_unit_person').value;
        let eng_structure_type=Ext.getCmp('eng_structure_typeAA').value;

        let panel =Ext.getCmp('basicInformationPanel');
        panel.mask('正在加载数据请稍后');
        Ext.Ajax.request({
            url: '/engInformationRoutes',
            method: "POST",
            async: true,  //异步调用AJAX
            params: {
                action_type: 'engInformationUpdate',
                structure_id:eng_structure_type,

                engineering_id:engineering_id,
                engineering_area:engineering_area,
                engineering_address:engineering_address,
                aboveGround_floor:aboveGround_floor,
                underGround_floor:underGround_floor,
                admission_construction_date:admission_construction_date,
                admission_construction_status:admission_construction_status,
                supervisory_registration_certificate:supervisory_registration_certificate,
                planning_certificate:planning_certificate,
                drawing_number:drawing_number,
                construction_permit:construction_permit,
                construction_unit_employer_id:construction_unit_employer_id,
                design_unit_id:design_unit_id,
                construction_unit_contractor_id:construction_unit_contractor_id,
                supervisory_unit_id:supervisory_unit_id,
                survey_unit_id:survey_unit_id,
                drawing_unit_id:drawing_unit_id,
                startDate:startDate,
                principal_id:principal_id,
                building_use:building_use,
                engineering_name:engineering_name,
                user_ids:user_ids,
                construction_unit_employer_person:construction_unit_employer_person,
                design_unit_person:design_unit_person,
                construction_unit_contractor_person:construction_unit_contractor_person,
                supervisory_unit_person:supervisory_unit_person,
                survey_unit_person:survey_unit_person,
                drawing_unit_person:drawing_unit_person
            },
            success: function (response, opts) {
                panel.unmask();
                Ext.toast('成功');
                let me=Ext.getCmp('basicInformationPanel');
                me.show();
            },
            failure: function () {
                Ext.toast(`获取异常报警数据失败：${response.status}`);
            }  // 请求失败的回调函数
        });

    }
});